<!-- eslint-disable vue/multi-word-component-names -->
<template>
    <ul class="list">
        <template v-for="(item, index) in listData" :key="item">
            <li>
                <a class="item" :href="item.url" target="_blank">
                    <span class="index">{{ index + 1 }}</span>
                    <span class="title">{{ item.title }}</span>
                </a>
            </li>
        </template>
    </ul>
</template>
<script lang="ts" setup>
    const props = defineProps<{
        listData: any[];
    }>();
</script>

<style scoped>
    .item {
        display: flex;
        align-items: center;
        font-size: 1rem;
        line-height: 1.3;
        color: var(--text-color);
        margin-top: 0.67rem;
    }

    .item:hover .title {
        color: var(--hover-text-color);
        border-bottom: 1px solid #5556;
    }

    .item .index {
        width: 1.2rem;
        line-height: 1.2rem;
        margin-right: 0.66rem;
        display: inline-block;
        text-align: center;
        border-radius: 4px;
        font-size: 0.8rem;
        background-color: #282828;
    }
</style>
